import { RMIObject } from "../../Engine/RMI/RMIObject";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SLoginReturn } from "./SLoginReturn";
import { Exception } from "../../Framework/Util/Exception";
//class AMI_ILogin_createFirstRole

export class AMI_ILogin_createFirstRole extends RMIObject {
  constructor(_response?: Function, _ex?: Function, arg3?: any) {
    super(_response, _ex);
    this.userObject = arg3;
    this.callFunction = "createFirstRole";
  }

  public /* override */ __response(stream: SerializeStream): void {
    try {
      var sReturn = new SLoginReturn();
      sReturn.__read(stream);
    } catch (__ex) {
      this.cdeException(
        new Exception(
          "ExceptionCodeSerialize",
          Exception.ExceptionCodeSerialize
        )
      );
      return;
    }
    this.cdeResponse(sReturn);
    return;
  }

  public cdeResponse(arg1: SLoginReturn): void {
    if (this._response) {
      this._response.call(null, this, arg1);
    }
  }
}
